package com.mq.rabbitmq.topic.demo1;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Administrator on 2017/8/11.
 */
public class TopicSend {
    @Autowired
    RabbitTemplate rabbitTemplate;
    public void send(String content) {
        System.out.println("topic send content");
        rabbitTemplate.convertAndSend(TopicConfig.EXCHANGE, TopicConfig.ROUTINGKEY1, content);
//        while(true);
    }



//    public void send1() {
//        String context = "hi, i am message 1";
//        System.out.println("Sender : " + context);
//        this.rabbitTemplate.convertAndSend("exchange", "topic.message", context);
//    }

//    public void send2() {
//        String context = "hi, i am messages 2";
//        System.out.println("Sender : " + context);
//        this.rabbitTemplate.convertAndSend("exchange", "topic.messages", context);
//    }
}
